
<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="../../css/mui.min.css" />
	</head>
	<style type="text/css">
		body{
			background:#F3F3EF;
		}
		.mui-bar-nav {
			background: #21B0FD;
			-webkit-box-shadow: none;
			box-shadow: none
		}
		
		.mui-icon-left-nav {
			color: #fff;
		}
		
		.mui-title {
			color: #fff;
		}
		
		.list {
			font-size: 12px;
			color: #fff;
			padding: 12px 0;
		}
		
		.mui-bar-tab {
			-webkit-box-shadow: none;
			box-shadow: none;
			border-bottom: 1px solid #EAEAEA;
			position: initial;
			height: 33px;
			background: #fff;
		}
		
		.mui-bar-tab>.mui-tab-item {
			height: 33px;
			color: #999;
			font-size: 14px;
		}
		
		.footer {
			position: fixed;
			bottom: 0;
			width: 100%;
		}
		
		.footer>button {
			width: 100%;
			border-radius: 0;
			font-size: 16px;
			padding: 10px 0;
		}
		
		.mui-slider-progress-bar {
			transition: .3s;
			top: -3px;
		}
		
		#sliderProgressBar>div {
			height: 2px;
			background: #21B0FD;
			width: 50%;
			margin: 0 auto;
		}
		
		.mui-btn .mui-icon-mic {
			font-size: 20px;
			display: inline-block;
			margin-right: 6px;
		}
	</style>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">标题</h1>
			<span class="list mui-pull-right">排行榜</span>
		</header>
		<div class="mui-content">
			<nav class="mui-bar mui-bar-tab">
				<a id="defaultTab" class="mui-tab-item mui-active" href="teacherreads.html">
					<span class="mui-tab-label">朗读作业</span>
				</a>
				<a class="mui-tab-item bookcity" href="hotread.html">
					<span class="mui-tab-label">热门</span>
				</a>
				<a class="mui-tab-item shaixing" href="hotread2.html">
					<span class="mui-tab-label">最新</span>
				</a>
			</nav>
			<div id="sliderProgressBar" class="mui-slider-progress-bar mui-col-xs-4">
				<div></div>
			</div>
		</div>
		<div class="footer">
			<!--<span class="mui-icon mui-icon-mic"></span>-->
			<button type="button" class="mui-btn mui-btn-success"><span class="mui-icon mui-icon-mic"></span><span>我来朗读</span></button>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/libs/zepto_1.1.3.js"></script>
		<script src="../../js/libs/vue.js"></script>
		<script src="../../js/common/common.js"></script>
		<script type="text/javascript">
			mui.init();
			var subpages = ['teacherreads.html', 'hotread.html', 'hotread2.html'];
			var subpage_style = {
				top: '78px',
				bottom: '44px'
			};
			var aniShow = {};
			
			
			$(".list").on("tap",function(){
				common.open("paixinban.html")
			})
			
			
			
			
			 //创建子页面，首个选项卡页面显示，其它均隐藏；
			mui.plusReady(function() {
				var self = plus.webview.currentWebview();
				for (var i = 0; i < 3; i++) {
					var temp = {};
					var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
					if (i > 0) {
						sub.hide();
					}else{
						temp[subpages[i]] = "true";
						mui.extend(aniShow,temp);
					}
					self.append(sub);
				}
			});
			 //当前激活选项
			var activeTab = subpages[0];
			var title = document.getElementById("title");
			 //选项卡点击事件
			mui('.mui-bar-tab').on('tap', 'a', function(e) {
				var targetTab = this.getAttribute('href');
				if (targetTab == activeTab) {
					return;
				}
				//更换标题
			
				//显示目标选项卡
				//若为iOS平台或非首次显示，则直接显示
				if(mui.os.ios||aniShow[targetTab]){
					plus.webview.show(targetTab);
				}else{
					//否则，使用fade-in动画，且保存变量
					var temp = {};
					temp[targetTab] = "true";
					mui.extend(aniShow,temp);
					plus.webview.show(targetTab,"fade-in",300);
				}
				//隐藏当前;
				plus.webview.hide(activeTab);
				//更改当前活跃的选项卡
				activeTab = targetTab;
			});
			 //自定义事件，模拟点击“首页选项卡”
			document.addEventListener('gohome', function() {
				var defaultTab = document.getElementById("defaultTab");
				//模拟首页点击
				mui.trigger(defaultTab, 'tap');
				//切换选项卡高亮
				var current = document.querySelector(".mui-bar-tab>.mui-tab-item.mui-active");
				if (defaultTab !== current) {
					current.classList.remove('mui-active');
					defaultTab.classList.add('mui-active');
				}
			});
			
			
			mui.init()
			$(".mui-tab-item").on("tap", function() {
				var temp = 100 * Number($(this).index()) + "%"
				$(".mui-slider-progress-bar").css('transform', 'translateX(' + temp + ')')
			})
			
			
			$(".shaixing").on("tap",function(){
			    var load = plus.webview.getWebviewById("hotread.html");		
		        mui.fire(load,"hotread");
			})
			
			
			$(".bookcity").on("tap",function(){
				var load = plus.webview.getWebviewById("hotread.html");		
		        mui.fire(load,"hotread2");
			})
			
			$(".footer").on("tap",function(){
				common.open("addread.html")
			})
			
			
		</script>
	</body>

</html>